/* ----------------------------------------------------------------------------
* File: user_profile_impl.h
*
* Desc: Implementation for user profile
*
* Created: 07/05/2011, by Alexey Korshunov
* ---------------------------------------------------------------------------- */
#ifndef _USER_PROFILE_IMPL_H_
#define _USER_PROFILE_IMPL_H_

#include <vector>
#include "user_profile.h"


namespace ModuleManagement
{
	class UserProfileImpl : public UserProfile
	{
		typedef struct UserInfo
		{
			UserInfo() : points(0) {}
			std::string name;
			unsigned int points;
		}UserInfo;

		typedef std::vector<UserInfo*>				VectorUserInfo;
		typedef std::vector<UserInfo*>::iterator	VectorUserInfoIterator;

	public:
		explicit UserProfileImpl(const std::string& FileName) throw(Common::Exception);
		~UserProfileImpl();

		virtual int GivePoints(const std::string& User, unsigned int Points);

	private:
		void WriteUserInfo();

		VectorUserInfo m_UserInfo;
		std::string m_UserFile;
	};
}

#endif // _USER_PROFILE_IMPL_H_
